<?php

class Adept_Renderer_Form extends Adept_Renderer_Composite 
{
    
    public function renderBegin($component) 
    {
        $attributes = array(
            'id' => $component->getId(),
            'name' => $component->getName(),
            'class' => $component->getClass(),
            'accept' => $component->getAccept(),
            'acceptcharset' => $component->getAcceptCharset(),
            'action' => $component->getAction(),
            'method' => $component->getMethod(),
            'style' => $component->getStyle(),
            'enctype' => $component->getEnctype(),
            'target' => $component->getTarget(),
        );
        $component->getWriter()->writeHtmlTag('form', $attributes);
    }
    
    public function renderEnd($component)
    {
        $attributes = array(
            'type' => 'hidden',
            'name' => 'submitted[' . $component->getName() . ']',
            'value' => 1,
        );
        $component->getWriter()->writeHtmlTag('input', $attributes);
        $component->getWriter()->write("</form>");
    }

}